<?php
namespace Admin\Controller;
use Think\Controller;
class SupportController extends BaseController {
	
    public function index(){
        
            $admin=M();
            $content=I('get.content');
            $list_admin=$admin->table('ymn_list_admin')->where("name='".$content."'")->select();
            if(!$list_admin){
                //echo "<script>alert('无符合条目');</script>";
                $list_admin=$admin->table('ymn_list_admin')->select();
            }
            

           
            $this->assign('list_admin',$list_admin);
            
            $this->display();
        
        
    }
    
    public function edit_list(){
        $id=I('post.id');
        $info['name']=I('post.name');
        $info['type']=I('post.type');
        $info['version']=I('post.version'); 
        $info['channel_url']=I('post.channel_url');
        $info['link_url']=I('post.link_url');
        $info['intro']=I('post.intro'); 
        $info['state']=I('post.state');
        $info['update_time']=date('Y-m-d H:i:s');
        $admin=M();
        $result=$admin->table('ymn_list_admin')->where("id='".$id."'")->save($info);
       if($result){
        echo  "成功";
        
       }
    } 
    public function add_list(){
        $info['name']=I('post.name');
        $info['type']=I('post.type');
        $info['version']=I('post.version'); 
        $info['channel_url']=I('post.channel_url');
        $info['link_url']=I('post.link_url');
        $info['intro']=I('post.intro'); 
        $info['state']=I('post.state');
        $info['update_time']=date('Y-m-d H:i:s');
        $admin=M();
        $result=$admin->table('ymn_list_admin')->add($info);
        if($result){
            echo  "成功";
        
        }

    }
    public function release_list(){
        $id=I('post.id');
        $info['name']=I('post.name');
        $info['type']=I('post.type');
        $info['version']=I('post.version');
        $info['channel_url']=I('post.channel_url');
        $info['link_url']=I('post.link_url');
        $info['intro']=I('post.intro');
        $info['state']=I('post.state');
        var_dump($info);
        
         
        
        
        //发布
        

    
        echo "发布成功";
        
    }
    
}
   
